package com.collectplus.express.model;

import java.io.Serializable;
import java.util.ArrayList;

import droid.frame.utils.lang.Str;

/**
 * 包裹详情
 * 
 * @author JinFangXing <br>
 *         2016-9-29 下午6:21:17
 * @deprecated 后面用ParcelDetailBeanNew
 */
public class ParcelDetailBean implements Serializable {

	private static final long serialVersionUID = 35225626476243L;

	private int id;
	private int type;// 0：我的包裹（寄件） 1：我的包裹（收件） 2：passport

	private String bagCode;// 投递袋编码

	private String receiverName;// 收件人姓名
	private String receiverPhone;// 收件人电话
	private String receiverAddress;// 收件人详细地址
	// 寄件人字段
	private String sendName;
	private String sendPhone;
	private String sendAddress;

	private String expressCompanyName;// 快递公司名称

	private String expressNumber;// 快递单号

	private String title;// 寄件：待处理的包裹,在途中的包裹,已完成的包裹,"":（4种标题文字描述） 收件：待取包裹，在途中的包裹，已签收的包裹

	private String orderId;// 订单ID

	private String longitude;
	private String latitude;
	/**
	 * {@link Const.OrderStatus}
	 */
	private int orderStatus;// 订单状态
	/**
	 * {@link Const.ParcelStatus}
	 */
	private int parcelStatus; // 包裹状态

	private String cost;// 报价
	private String realCost; // 实际支付费用

	private int evaluatedId;// 评价表Id：是否评价,默认0

	private int parcelType;// 寄件方式（寄件） 0：标准 1：有袋到柜 2：有袋上门、3有袋到驿站

	private String parcelImgUrl;// 包裹图片

	private int parcelMark;// 对应，待处理包裹：0 ，在途中的包裹：1 ，完成的包裹：2

	private String serviceCost;// 上门费用

	private String boxAddress;// 快递柜网店地址

	private String boxCode;// 用户预约码，用户放入快递柜时存在，放入后清空

	private String checkCode;//

	private long orderTime;// 下单时间

	private String address;// 上门地址

	private long couterTime;// 支付时间+有效时间

	private ArrayList<OrderRouterBean> routeList;// 路由集合

	private long serviceTimeLe;// 服务结束时间

	private long serviceTimeGe;// 服务开始时间

	// coffee add
	private String courierName;// 快递员姓名

	private String courierPhone;// 快递员电话

	private String courierURL;// 快递员头像

	private String category;// 物品类型

	/**
	 * 服务店id
	 */
	private String postStationId;

	/**
	 * 营业时间
	 */
	private String postStationTime;

	/**
	 * 驿站名字
	 */
	private String postStationName;

	/**
	 * 驿站地址 passport
	 */
	private String postStationAddress;

	/**
	 * 驿站电话
	 */
	private String postStationPhone;

	/**
	 * 投递点 详情页 APP
	 */
	private String postStationDeliverAddress;

	/**
	 * 
	 */
	public ParcelDetailBean() {
		super();
	}

	public String getCode() {
		// 有袋到柜
		if (parcelType == 1) {
			return boxCode;
		} else {// 上门、寄件码
			return checkCode;
		}
	}

	public String getServiceAddress() {
		if (getParcelType() == Const.ParcelType.bagToStation) {
			return postStationAddress;
		} else if (getParcelType() == Const.ParcelType.bagToBox) {
			return boxAddress;
		} else {
			return address;
		}
	}

	/**
	 * 获取寄件方式
	 * 
	 * @return
	 */
	public String getSendType() {
		if (parcelType == Const.ParcelType.bagToBox || parcelType == Const.ParcelType.bagToStation) {
			return "投递点寄件";
		} else {
			return "裹儿到家寄件";
		}
	}

	// ///////////////////////////////////
	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	public String getBagCode() {
		return bagCode;
	}

	public void setBagCode(String bagCode) {
		this.bagCode = bagCode;
	}

	public String getReceiverName() {
		return receiverName;
	}

	public void setReceiverName(String receiverName) {
		this.receiverName = receiverName;
	}

	public String getReceiverPhone() {
		return receiverPhone;
	}

	public void setReceiverPhone(String receiverPhone) {
		this.receiverPhone = receiverPhone;
	}

	public String getReceiverAddress() {
		return receiverAddress;
	}

	public void setReceiverAddress(String receiverAddress) {
		this.receiverAddress = receiverAddress;
	}

	public String getSendName() {
		return sendName;
	}

	public void setSendName(String sendName) {
		this.sendName = sendName;
	}

	public String getSendPhone() {
		return sendPhone;
	}

	public void setSendPhone(String sendPhone) {
		this.sendPhone = sendPhone;
	}

	public String getSendAddress() {
		return sendAddress;
	}

	public void setSendAddress(String sendAddress) {
		this.sendAddress = sendAddress;
	}

	public String getExpressCompanyName() {
		return expressCompanyName;
	}

	public void setExpressCompanyName(String expressCompanyName) {
		this.expressCompanyName = expressCompanyName;
	}

	public String getExpressNumber() {
		return expressNumber;
	}

	public void setExpressNumber(String expressNumber) {
		this.expressNumber = expressNumber;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getOrderId() {
		return orderId;
	}

	public void setOrderId(String orderId) {
		this.orderId = orderId;
	}

	public String getCost() {
		return cost;
	}

	public void setCost(String cost) {
		this.cost = cost;
	}

	public int getEvaluatedId() {
		return evaluatedId;
	}

	public void setEvaluatedId(int evaluatedId) {
		this.evaluatedId = evaluatedId;
	}

	public int getParcelType() {
		return parcelType;
	}

	public void setParcelType(int parcelType) {
		this.parcelType = parcelType;
	}

	public int getParcelMark() {
		return parcelMark;
	}

	public void setParcelMark(int parcelMark) {
		this.parcelMark = parcelMark;
	}

	public String getServiceCost() {
		return serviceCost;
	}

	public void setServiceCost(String serviceCost) {
		this.serviceCost = serviceCost;
	}

	public String getBoxAddress() {
		return boxAddress;
	}

	public void setBoxAddress(String boxAddress) {
		this.boxAddress = boxAddress;
	}

	public String getBoxCode() {
		return boxCode;
	}

	public void setBoxCode(String boxCode) {
		this.boxCode = boxCode;
	}

	public long getOrderTime() {
		return orderTime;
	}

	public void setOrderTime(long orderTime) {
		this.orderTime = orderTime;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public long getCouterTime() {
		return couterTime;
	}

	public void setCouterTime(long couterTime) {
		this.couterTime = couterTime;
	}

	public ArrayList<OrderRouterBean> getRouteList() {
		return routeList;
	}

	public void setRouteList(ArrayList<OrderRouterBean> routeList) {
		this.routeList = routeList;
	}

	public long getServiceTimeLe() {
		return serviceTimeLe;
	}

	public void setServiceTimeLe(long serviceTimeLe) {
		this.serviceTimeLe = serviceTimeLe;
	}

	public long getServiceTimeGe() {
		return serviceTimeGe;
	}

	public void setServiceTimeGe(long serviceTimeGe) {
		this.serviceTimeGe = serviceTimeGe;
	}

	public String getCourierName() {
		return courierName;
	}

	public void setCourierName(String courierName) {
		this.courierName = courierName;
	}

	public String getCourierPhone() {
		return courierPhone;
	}

	public void setCourierPhone(String courierPhone) {
		this.courierPhone = courierPhone;
	}

	public String getCourierURL() {
		return courierURL;
	}

	public void setCourierURL(String courierURL) {
		this.courierURL = courierURL;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	public String getCheckCode() {
		return checkCode;
	}

	public void setCheckCode(String checkCode) {
		this.checkCode = checkCode;
	}

	public int getOrderStatus() {
		// 如果是有袋上门并且支付完成，此时订单状态为2
		if (getParcelType() == Const.ParcelType.bagToHome && orderStatus == Const.OrderStatus.dispathed) {
			orderStatus = Const.OrderStatus.payed;
		}
		return orderStatus;
	}

	public void setOrderStatus(int orderStatus) {
		this.orderStatus = orderStatus;
	}

	public String getParcelImgUrl() {
		return parcelImgUrl;
	}

	public void setParcelImgUrl(String parcelImgUrl) {
		this.parcelImgUrl = parcelImgUrl;
	}

	public int getParcelStatus() {
		return parcelStatus;
	}

	public void setParcelStatus(int parcelStatus) {
		this.parcelStatus = parcelStatus;
	}

	public String getLongitude() {
		return longitude;
	}

	public void setLongitude(String longitude) {
		this.longitude = longitude;
	}

	public String getLatitude() {
		return latitude;
	}

	public void setLatitude(String latitude) {
		this.latitude = latitude;
	}

	public String getRealCost() {
		if (Str.isEmpty(realCost)) {
			return cost;
		}
		return realCost;
	}

	public void setRealCost(String realCost) {
		this.realCost = realCost;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getCategory() {
		return category;
	}

	public void setCategory(String category) {
		this.category = category;
	}

	public String getPostStationId() {
		return postStationId;
	}

	public void setPostStationId(String postStationId) {
		this.postStationId = postStationId;
	}

	public String getPostStationTime() {
		return postStationTime;
	}

	public void setPostStationTime(String postStationTime) {
		this.postStationTime = postStationTime;
	}

	public String getPostStationName() {
		return postStationName;
	}

	public void setPostStationName(String postStationName) {
		this.postStationName = postStationName;
	}

	public String getPostStationAddress() {
		return postStationAddress;
	}

	public void setPostStationAddress(String postStationAddress) {
		this.postStationAddress = postStationAddress;
	}

	public String getPostStationPhone() {
		return postStationPhone;
	}

	public void setPostStationPhone(String postStationPhone) {
		this.postStationPhone = postStationPhone;
	}

	public String getPostStationDeliverAddress() {
		return postStationDeliverAddress;
	}

	public void setPostStationDeliverAddress(String postStationDeliverAddress) {
		this.postStationDeliverAddress = postStationDeliverAddress;
	}
}
